-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(google-genai): Check Google Generative AI Structured Output #7293
feat(google-genai): Check Google Generative AI Structured Output #7293
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
temperature: 0.7, | ||
}); | ||
const structuredLlm = model.withStructuredOutput(schema); | ||
const request = "Generate structured data where age is a number."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem like a reliable test - shouldn't we expect an error to be thrown? Going to skip this one.
expect(result.details).toHaveProperty("address"); | ||
}); | ||
|
||
test("Google AI - Handle missing required fields", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above - this test will pass if the request doesn't throw an error.
expect(result).toHaveProperty("email"); | ||
}); | ||
|
||
test("Google AI - Throw error for empty response", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems those tests in the above comments were not throwing errors at all
Removed for now, will merge the rest. Thank you!
Fixes #6901
This PR addresses Issue #6901, which occurred when attempting to generate structured output using Google's Generative AI. The initial fix for this issue was implemented in PR #7213, and this PR extends the coverage by adding dedicated test cases to ensure the fix's correctness and stability.